package com.tarena.lbs.basic.web.utils;

import com.tarena.lbs.common.passport.principle.UserPrinciple;

public class ThreadLocalUtils {
    private static ThreadLocal<UserPrinciple> threadCarries = new ThreadLocal();
    public static void setValue(UserPrinciple user){
        threadCarries.set(user);
    }
    public static UserPrinciple getValue(){
        return threadCarries.get();
    }
    //清除数据
    public static void clear(){
        threadCarries.remove();
    }
}
